//
//  JGLogoutAlertView.m
//  JGRider
//
//  Created by 单启志 on 2018/2/1.
//  Copyright © 2018年 ffq. All rights reserved.
//

#import "JGLogoutAlertView.h"
@interface JGLogoutAlertView()
@property (weak, nonatomic) IBOutlet UIButton *confirmBtn;
@property (weak, nonatomic) IBOutlet UIButton *backBtn;

@end
@implementation JGLogoutAlertView

-(instancetype)initWithFrame:(CGRect)frame{

    if (self=[super initWithFrame:frame]) {
        self=[[[NSBundle mainBundle]loadNibNamed:NSStringFromClass([self class]) owner:nil options:nil]lastObject];
        self.frame=frame;
    }
    return self;
}

-(void)awakeFromNib{
    [super awakeFromNib];
}

#pragma mark -event response
//确定
- (IBAction)onConfirmBtnClick:(id)sender {
    if ([self.delegate respondsToSelector:@selector(LogoutAlertViewConfirmEvent)]) {
        [self.delegate LogoutAlertViewConfirmEvent];
    }
}
//返回
- (IBAction)onBackBtnClick:(id)sender {
    if ([self.delegate respondsToSelector:@selector(LogoutAlertViewBackEvent)]) {
        [self.delegate LogoutAlertViewBackEvent];
    }
}


-(void)layoutSubviews{
    [super layoutSubviews];
    
    self.layer.cornerRadius=AdaptedHeight(2);
    self.layer.masksToBounds=YES;
    self.confirmBtn.layer.cornerRadius=AdaptedHeight(2);
    self.confirmBtn.layer.masksToBounds=YES;

    self.backBtn.layer.cornerRadius=AdaptedHeight(2);
    self.backBtn.layer.masksToBounds=YES;
}

@end
